<template>
	<view class="">
		<u-popup :show="showPop" mode="center" @close="close" height="200px" customStyle="width:90%">
			<view class="p-3">
				<view class="title" style="text-align: center;color: black;">
					{{title||'提示'}}
				</view>
				<view scroll-y="false" style="height: 100rpx;">
					<view class="" style="margin-top: 15px;color: #979797; display: flex;">
						<view style="margin-left: 0px;width: 94.5%;">
							<view class="item">
								<vvSelect placeholder="选择置业顾问" class="select" :list="type_list" label="name"
									valueKey="type_id" ref="vvSelect1" @change="pickerChange"></vvSelect>
								<view class="arrow">
									<!-- <image src="../../static/selectBot.png" mode="" v-if="form.type_id == ''"></image> -->
									<u-icon name="arrow-down" color="#505050;" v-if="form.type_id == ''" size="16"
										@click="closeSel1">
									</u-icon>
									<u-icon name="close" color="#505050;" v-if="form.type_id" size="16"
										@click="closeSel1">
									</u-icon>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="f-row jc-sb">
					<view style="width: 40%;">
						<u-button text="取消" type='info' @click='refuse' v-if="!showqx"></u-button>
					</view>
					<view style="width: 40%;">
						<u-button class="custom-style" text="确认" customStyle="background: linear-gradient(90deg, #0873DE 0%, #0873DE 100%);color:#fff"
							@click="submit"></u-button>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import vvSelect from '@/components/vv-select/vv-select.vue'
	export default {
		props: ['showPop', 'title', 'tip', 'showqx'],
		components: {
			vvSelect,
		},
		data() {
			return {
				show: false,
				type_list: [{
					name: '张三',
					type_id: '1'
				}],
				form: {
					type_id: '',
					page: 1
				},
			}
		},
		methods: {
			// 注意返回值为一个数组，单列时取数组的第一个元素即可(只有一个元素)
			submit(e) {
				this.$emit('submit')
			},
			refuse() {
				this.$emit('refuse', true)
			},
			pickerChange(e) {
				this.form.type_id = e
				this.projectListData = []
				this.projectList()
			},
			closeSel1() {
				this.form.type_id = ''
				this.$refs.vvSelect1.emptCheckLabels()
				this.form.page = 1
				this.projectListData = []
				this.projectList()
			},
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		border: 1px solid #f2f2f2;
		width: 100%;
		display: flex;
		background: rgba(255, 255, 255, 0.5);
		padding: 15rpx;
		.select {
			flex: 1;
		}

		.arrow {
			width: 20rpx;
			height: 20rpx;
			margin-right: 8rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}
</style>
